<template>
	<view>
		<view class="warp-index">
			<view class="index-top">
				<view class="top-tx-box">
					<image style="width: 150rpx;height: 150rpx;" src="/static/images/my_logo.png" mode=""></image>
					<view class="user-info">
						<view class="user-bar">王村</view>
						<view class="user-op">
							<view @click="uploadAvatar">修改头像</view>
							<view class="upload-avatar" @click="uploadAvatar">上传头像</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="index-group">
			<view class="group-title">
				巡查上报
			</view>
			<view class="useri-row">
				<view class="useri-left">登陆名:</view>
				<view class="useri-right">8214010102</view>
			</view>
			<view class="useri-row">
				<view class="useri-left">电话:</view>
				<view class="useri-right">12345678911</view>
			</view>
			<view class="useri-row">
				<view class="useri-left">部门:</view>
				<view class="useri-right">王村</view>
			</view>
		</view>
		<view class="btn">退出</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			uploadAvatar(){
				uni.chooseImage({
					 success: (chooseImageRes) => {
					        const tempFilePaths = chooseImageRes.tempFilePaths;
							console.log(tempFilePaths);
					        // uni.uploadFile({
					        //     url: 'https://www.example.com/upload', //仅为示例，非真实的接口地址
					        //     filePath: tempFilePaths[0],
					        //     name: 'file',
					        //     formData: {
					        //         'user': 'test'
					        //     },
					        //     success: (uploadFileRes) => {
					        //         console.log(uploadFileRes.data);
					        //     }
					        // });
					    }
				})
			}
		}
	}
</script>

<style>
	.warp-index{
		width: 100%;
		height: 100%;
	}
	.index-top{
		width: 100%;
		background: #409eff;
		padding: 32rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}
	.user-info{
		flex:1;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		height: 150rpx;
		padding-left:40rpx;
		
	}
	.top-tx-box{
		width: 100%;
		display: flex;
		align-items: center;
	}
	.top-tx-box text{
		color: #fff;
		font-size: 32rpx;
	}
	.user-bar{
		color: #fff;
		font-size: 40rpx;
		margin: 0 35rpx 0 20rpx;
	}
	.index-top-info{
		width: 100%;
		height: 65%;
		display: flex;
	}
	.info-bar{
		width: 50%;
		display: flex;
		flex-direction: column;	
		justify-content: center;
		align-items: center;
		color: #fff;
	}
	.user-op{
		display: flex;
		color:#fff;
	}
	.upload-avatar{
		margin-left:60rpx;
	}
	.count{
		font-size: 70rpx;
	}
	.index-group{
		width: 100%;
		height: auto;
	}
	.group-title{
		width: 100%;
		height: 100rpx;
		padding:0 40rpx;
		display: flex;
		align-items: center;
		background-color: #eee;
		color: rgb(64, 158, 255);
		font-size: 32rpx;
		border-bottom: 2rpx solid #ccc;
	}
	.useri-row{
		width: 100%;
		height: 90rpx;
		line-height: 90rpx;
		display: flex;
		border-bottom: 2rpx solid #dedede;
	}
	.useri-left{
		width: 30%;
		color:#696969;
		padding-left:30rpx;
		font-size: 32rpx;
	}
	.useri-right{
		color:#333;
		font-size: 32rpx;
	}
	.info-bottom{
		font-size: 32rpx;
		margin-top: 10rpx;
	}
	.btn{
		width: 96%;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		border-radius: 10rpx;
		font-size: 36rpx;
		color:#fff;
		margin:120rpx auto;
		background-color: rgb(64, 158, 255);
	}
</style>
